/*
#################################################################################
#
# Copyright (c) 2006 Michigan State University
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#################################################################################

#################################################################################
#
#	Author:
#		Nathan Collins <npcollins@gmail.com>
#
#################################################################################
*/


var tip_count = 9;
var tips = new Array(tip_count);
var last_tip = -1;

tips[0] = "You can search by field by using the field name and a colon. <br>e.g. title:\"president lincoln\"";
tips[1] = "Click on 'Expand' next to a record link to view all the metadata associated with it.";
tips[2] = "Modern browsers like Mozilla Firefox or Netscape support more search features than Internet Explorer.";
tips[3] = "If you have any suggestions to make this OAI search better, email us at " + "colli372" + "@" + "msu" + "." + "edu.";
tips[4] = "If you come across a bug while searching, please report it to " + "colli372" + "@" + "msu" + "." + "edu.<br>We can only fix bugs we know about!";
tips[5] = "To specify a word or phrase that you do NOT want in your results, just place a dash( - ) before it.";
tips[6] = "The OAI Search is a developing project. New features are being added all the time.";
tips[7] = "Clicking on an author's name will do a quick search for all records by that author.";
tips[8] = "Results with a yellow background do not have a valid link to the document.<br>However, metadata and additional options are provided.";
tips[9] = "You can use AND and OR (case-sensitive) to do boolean queries.";

function rand_tip() {
	var tip_num = Math.round(Math.random() * tip_count);
	return tip_num;
}

function show_tip() {
	// prevent duplicate tips
	var cur_tip = rand_tip();
	while (cur_tip == last_tip) {
		cur_tip = rand_tip();
	}
	last_tip = cur_tip;
	
	tipWin = document.getElementById('tip1');
	
	tipWin.style.opacity = 0;
	tipWin.style.visibility = 'hidden';
	tipWin.innerHTML = tips[cur_tip];
	tipWin.style.visibility = 'visible';
	var again = window.setTimeout("vis_tip(0)",100)
}

function fade_tip(opac) {
	if (opac > 0) {
		document.getElementById('tip1').style.opacity = opac - 0.1;
		var again = window.setTimeout("fade_tip(" + (opac - 0.1) + ")",100)
	}
	else {
		var again = window.setTimeout("show_tip()",100)
	}
}

function vis_tip(opac) {
	if (opac < 1) {
		document.getElementById('tip1').style.opacity = opac + 0.1;
		var again = window.setTimeout("vis_tip(" + (opac + 0.1) + ")",100)
	}
	else {
		var again = window.setTimeout("fade_tip(1)",8000)
	}
}

/* eof */
